﻿using System;
using System.Runtime.InteropServices;

namespace IupNET
{

    public enum BinFileModule
    {
        RawFile,   /**< System dependent file I/O Rotines. */
        Stream,    /**< Standard Ansi C Stream I/O Rotines. */
        MemFile,   /**< Uses a memory buffer (see \ref imBinMemoryFileName). */
        SubFile,   /**< It is a sub file. FileName is a imBinFile* pointer from any other module. */
        FileHandle,/**< System dependent file I/O Rotines, but FileName is a system file handle ("int" in UNIX and "HANDLE" in Windows). */
        IOCustom0  /**< Other registered modules starts from here. */
    };

    public static class Imc
    {
        const string module = "iupnet-c.dll";
       
        [DllImport(module)]
        public extern static BinFileModule BinFileSetCurrentModule(BinFileModule mode);

        [DllImport(module)]
        public extern static IntPtr CreateMemFileName(ref byte membuffer,int bulen);

        [DllImport(module)]
        public extern static void DestroyMemeFileName(IntPtr memfilename);

        
    }
}
